from django.db import models

# Create your models here.
from movie.models import Movie
from user.models import BaseModel, User


class Order(BaseModel):
    user = models.ForeignKey(to=User, on_delete=models.CASCADE)
    movie = models.ForeignKey(to=Movie, on_delete=models.CASCADE)
    number = models.IntegerField(default=1)
    total = models.DecimalField(max_digits=10, decimal_places=2)

    class Meta:
        db_table = 'order'
